package com.lw.question07;

import java.util.ArrayList;
import java.util.Scanner;

/**
 * @author LW
 * @2020/9/16 14:37
 */
public class 数字重复次数1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
//        String[] str = scanner.nextLine().split(" ");
        int[] arr = new int[9];
        for (int i = 0; i < arr.length; i++) {
            arr[i]=scanner.nextInt();//输入
        }
        int maxCount = 0;
        int index = 0;    //用来标记取到相等值的下标
        int num = 0;	  //用来标记最后确定最大次数值的下标
        for (int i = 0; i < arr.length; i++) {
            int temp = arr[i];
            int count = 0;
            for (int j = 0; j < arr.length; j++) {
                if (temp==arr[j]){//重复的数量count++
                    count++;
                    index=j;//重复中的索引，重复的为一组
                    System.out.println("=="+index);
                }
            }
            if (maxCount<count){
                maxCount = count;//最大重复次数的取代
                num = arr[index];
                System.out.println("-->"+arr[index]);
            }
        }
        System.out.println("最多的次数:"+maxCount+" 字符为:"+num);


    }
}
